Y.use("node",function(a){window.Site=Singleton.create({ready:function(){this.resetGalleryPosition();a.one(".collection-type-index")&&this.resetIndexGalleryPosition();a.one(".collection-type-blog.view-list .sqs-featured-posts-gallery")&&a.one("body").addClass("has-banner-image");a.on("domready",function(){this.init();this.bindUI();this.syncUI()},this)},init:function(){this.forceMobileNav();this.promotedGalleryShrink();a.one(".has-promoted-gallery")?(this.textShrink(".meta-description p \x3e strong",
"p"),this.textShrink(".meta-description p \x3e em \x3e strong","p")):(this.textShrink(".desc-wrapper p \x3e strong","p"),this.textShrink(".desc-wrapper p \x3e em \x3e strong","p"));this.textShrink(".post-title a",".post-title");this.textShrink(".blog-item-wrapper .post-title",".title-desc-wrapper");this._touch=a.one(".touch-styles");a.one(".collection-type-blog.view-list .sqs-featured-posts-gallery")&&this.makeFeaturedGallery(".posts",".post");this.hideArrowsWhenOneSlide();this.repositionCartButton();
if(!this._touch){var b=a.one("#preFooter");!1===b.inViewportRegion()&&b.addClass("unscrolled");a.one(window).on("scroll",function(){b.hasClass("unscrolled")&&b.toggleClass("unscrolled",!b.inViewportRegion())})}},bindUI:function(){a.one(window).on("resize",this.syncUI,this);if(a.one("#mobileNavToggle"))a.one(".body-overlay").on("click",function(b){b.preventDefault();a.one("#mobileNavToggle").set("checked",!1)});var b=a.throttle(a.bind(function(){this.bindScroll("#preFooter",0.6*a.one("#preFooter").height())},
this),200);if(!this._touch)a.one(window).on("scroll",b);a.all(".subnav").each(function(b){b._node.getBoundingClientRect().right>a.config.win.innerWidth&&b.addClass("right")});a.all('#sidecarNav a[href^\x3d"#"], #sidecarNav a[href^\x3d"/#"], #sidecarNav a[href^\x3d"/"][href*\x3d"#"]').each(function(b){b.on("click",function(d){d.halt();a.one("#mobileNavToggle").set("checked",!1);a.later(300,this,function(){var d=b.getAttribute("href");-1<d.indexOf("#")&&(d=d.substr(d.indexOf("#")));var f=a.one(d);f&&
helper.smoothScrollTo(f.getY());history.pushState({},d,d)})},this)},this);this.showIndexNavOnScroll();this.disableHoverOnScroll()},syncUI:function(){this._touch||a.one(".force-mobile-nav")||640>=window.innerWidth?(helper.radioCheckboxes("#mainNavigation"),helper.radioCheckboxes("#mobileNavigation")):(helper.folderRedirect("#headerNav .folder-toggle-label"),helper.folderRedirect("#footer .folder-toggle-label"));this.forceMobileNav();helper.debounce(function(){this.addPaddingToFooter()})},bindScroll:function(b,
c){var d;d||(d=a.one(b+".unscrolled"));if(d){var e=window.pageYOffset+a.one("body").get("winHeight"),f=d.getY()+(c||0);e>=f&&d.removeClass("unscrolled")}},_atLeast:0,forceMobileNav:function(){var b=a.one("#mainNavWrapper");if(b){var c=a.one("body").get("winWidth"),d=a.one("#header"),e;e=a.one("#logoWrapper")?parseInt(a.Squarespace.Template.getTweakValue("logoContainerWidth"),10):parseInt(a.Squarespace.Template.getTweakValue("siteTitleContainerWidth"),10);c>this._atLeast?(a.one("body").removeClass("force-mobile-nav"),
d=d.get("offsetWidth")-parseInt(d.getStyle("paddingLeft"),10)-parseInt(d.getStyle("paddingRight"),10),b=b.get("offsetWidth"),b>d-e&&(a.one("body").addClass("force-mobile-nav"),this._atLeast=c)):a.one("body").addClass("force-mobile-nav")}},makeFeaturedGallery:function(b,c){new a.Squarespace.Gallery2({autoHeight:!1,container:b,slides:c,elements:{next:".next-slide, .simple .next, .sqs-gallery-controls .next",previous:".previous-slide, .simple .previous, .sqs-gallery-controls .previous",controls:".dots, .circles",
currentIndex:".current-index",totalSlides:".total-slides"},loop:!0,loaderOptions:{load:!0},design:"stacked",designOptions:{transition:"fade",clickBehavior:"auto"},refreshOnResize:!0})},promotedGalleryShrink:function(){var b,c,d;a.one(".has-promoted-gallery #promotedGalleryWrapper .meta")&&(b=a.one("#promotedGalleryWrapper").get("offsetHeight"),a.one(".transparent-header")&&(b-=90),a.all(".has-promoted-gallery #promotedGalleryWrapper .meta").each(function(a){a.setStyle("display","block");c=a.get("offsetHeight");
c>b&&(d=a.ancestor(".slide"),d.addClass("reduce-text-size"),c=a.get("offsetHeight"),c>b&&(d.removeClass("reduce-text-size"),d.addClass("hide-body-text"),c=a.get("offsetHeight"),c>b&&d.addClass("reduce-text-size")));a.setAttribute("style","")}))},textShrink:function(b,c){a.one(b)&&a.one(b).ancestor(c)&&a.all(b).each(function(b){b.plug(a.Squarespace.TextShrink,{parentEl:b.ancestor(c)})})},resetIndexGalleryPosition:function(){a.one(".collection-type-index .index-section:first-child .sqs-layout \x3e .sqs-row:first-child \x3e .sqs-col-12 \x3e .gallery-block:first-child .sqs-gallery-block-slideshow")&&
a.one("body").addClass("has-banner-image");a.one(".collection-type-index .index-section .sqs-layout \x3e .sqs-row:first-child \x3e .sqs-col-12 \x3e .gallery-block:first-child .sqs-gallery-block-slideshow")&&(a.one("body").addClass("has-promoted-gallery"),a.all(".collection-type-index .index-section .promoted-gallery-wrapper ~ .index-section-wrapper .sqs-layout \x3e .sqs-row:first-child \x3e .sqs-col-12 \x3e .gallery-block:first-child").each(function(a){a.one(".sqs-gallery-block-slideshow")&&a.ancestor(".index-section-wrapper").previous(".promoted-gallery-wrapper").addClass("promoted-full").append(a)}))},
resetGalleryPosition:function(){var b=a.one(".collection-type-page .main-content .sqs-layout \x3e .sqs-row:first-child \x3e .sqs-col-12 \x3e .gallery-block:first-child .sqs-gallery-block-slideshow"),c=a.one(".collection-type-page .main-content .sqs-layout \x3e .sqs-row:first-child \x3e .sqs-col-12 \x3e .gallery-block:first-child");b&&(a.one("#promotedGalleryWrapper .row .col").append(c),a.one("body").addClass("has-promoted-gallery").addClass("has-banner-image"))},hideArrowsWhenOneSlide:function(){a.one(".posts .post:only-child")&&
a.all(".circles").addClass("hidden")},repositionCartButton:function(){var b=a.one("#header").get("offsetHeight"),c=a.one(".sqs-cart-dropzone");c&&(a.one(".transparent-header.has-banner-image")?c.setStyle("top",b):c.setStyle("top",b+20))},showIndexNavOnScroll:function(){var b,c=function(){a.one(".index-section")&&(b=a.one(".index-section").get("offsetHeight"))};c();if(a.one(".collection-type-index")&&640>=window.innerWidth){var d=function(){0>=b-window.pageYOffset?a.one("body").addClass("fix-header-nav"):
a.one("body").removeClass("fix-header-nav")};a.one(window).on("resize",function(){c()});d();a.one(window).on("scroll",function(){d()},this);a.one(".mobile-nav-toggle-label.fixed-nav-toggle-label").on("click",function(){a.one("body").hasClass("fix-header-nav")&&a.one("body").removeClass("fix-header-nav")});a.one(window).on(["touchstart","MSPointerDown"],function(){this._timeout&&this._timeout.cancel();this.isHidden=!0;!0===this.isHidden&&(a.one(".mobile-nav-toggle-label.fixed-nav-toggle-label").setStyle("opacity",
1),this.isHidden=!1)},this);a.one(window).on(["touchend","MSPointerUp"],function(){this._timeout=a.later(1500,this,function(){this.isHidden=!0;a.one(".mobile-nav-toggle-label.fixed-nav-toggle-label").setStyle("opacity",0)})},this)}},addPaddingToFooter:function(){var b=parseInt(a.one("#footer").getStyle("paddingBottom"),10),c=a.one("#siteWrapper").get("offsetHeight"),d=a.one("body").get("winHeight");c-b<=d&&a.one("#footer").setStyle("paddingBottom",d-(c-b))},disableHoverOnScroll:function(){if(a.UA.mobile)return!1;
var b=document.head||document.getElementsByTagName("head")[0],c=document.createElement("style"),d=document.body,e;c.type="text/css";c.styleSheet?c.styleSheet.cssText=".disable-hover:not(.sqs-layout-editing), .disable-hover:not(.sqs-layout-editing) * { pointer-events: none  ; }":c.appendChild(document.createTextNode(".disable-hover:not(.sqs-layout-editing), .disable-hover:not(.sqs-layout-editing) * { pointer-events: none  ; }"));b.appendChild(c);window.addEventListener("scroll",function(){clearTimeout(e);
d.classList.contains("disable-hover")||d.classList.add("disable-hover");e=setTimeout(function(){d.classList.remove("disable-hover")},300)},!1)}})});
Y.use("node",function(){window.helper=Singleton.create({ready:function(){Y.on("domready",function(){this.bindUI()},this)},bindUI:function(){this.dataToggleBody();this.dataToggleEl();this.dataLightbox();Y.one(window).on("resize",this.syncUI,this)},syncUI:function(){helper.debounce(function(){helper.imgLoad()})},radioCheckboxes:function(a,b,c){a?Y.one(a)?(b=b||'[type\x3d"checkbox"]',c=c||"label[for]",1<Y.one(a).all(b).size()&&Y.one(a).delegate("click",function(c){c.preventDefault();c=Y.one("#"+c.currentTarget.getAttribute("for"));
!1===c.get("checked")?(Y.one(a).all(b).each(function(a){a.set("checked",!1)}),c.set("checked",!0)):c.set("checked",!1)},c)):console.warn("radioCheckboxes: No wrapper found on page."):console.warn("radioCheckboxes: Must define a wrapper.")},folderRedirect:function(a,b){a=a||"label[for]";b=b||"body";Y.one(a)&&Y.one(b).delegate("click",function(a){a.preventDefault();(a=a.currentTarget.getData("href"))?window.location=a:console.warn("folderRedirect: You must add a data-href attribute to the label.")},
a)},dataLightbox:function(){var a={};Y.all("[data-lightbox]").each(function(b){var c=b.getAttribute("data-lightbox");a[c]=a[c]||[];a[c].push({content:b,meta:b.getAttribute("alt")});b.on("click",function(d){d.halt();(new Y.Squarespace.Lightbox2({set:a[c],currentSetIndex:Y.all("[data-lightbox]").indexOf(b),controls:{previous:!0,next:!0}})).render()})})},dataToggleBody:function(){Y.one("body").delegate("click",function(a){Y.one("body").toggleClass(a.currentTarget.getData("toggle-body"))},"[data-toggle-body]")},
dataToggleEl:function(){Y.one("body").delegate("click",function(a){a=a.currentTarget;a.toggleClass(a.getData("toggle"))},"[data-toggle]")},debounce:function(a,b,c){b=b||100;c=c||Site;a&&(this._timeout&&this._timeout.cancel(),this._timeout=Y.later(b,c,a))},imgLoad:function(a){a=a||"img[data-src]";Y.one(a)&&Y.all(a).each(function(a){ImageLoader.load(a)})},scrollAnchors:function(a){a=a||'a[href^\x3d"#"]';if("string"!=typeof a)return console.error("helpers.js: scrollAnchors argument must be a string."),
!1;Y.one("body").delegate("click",function(a){if(a.currentTarget.hasClass("ignore-template-hash-behavior"))return!1;a.halt();a=a.currentTarget.getAttribute("href").replace(/\//,"");Y.one(a)&&this.smoothScrollTo(Y.one(a).getY());history&&history.pushState({},a,a)},a,this)},smoothScrollTo:function(a){if(NaN==parseInt(a))return console.warn("helpers.js: smoothScrollTo must have a scroll point passed to it."),!1;if(!Y.Lang.isNumber(a))try{a=parseInt(a)}catch(b){return console.warn("helpers.js: scrollTo was passed an invalid argument."),
!1}var c=new Y.Anim({node:Y.one(Y.UA.gecko||Y.UA.ie||navigator.userAgent.match(/Trident.*rv.11\./)?"html":"body"),to:{scrollTop:a},duration:0.4,easing:"easeOut"});c.run();c.on("end",function(){c.destroy()})}})});
Y.use("node",function(a){window.showOnScroll=Singleton.create({ready:function(){a.on("domready",function(){if(a.one(".collection-type-index")){if(a.one(".touch-styles"))return!1;this.initializer();this.bindUI();this.syncUI()}},this)},initializer:function(){(this.el=a.one(".show-on-scroll"))?(this.elOffset=a.one(this.el.getData("offset-el")),this.offsetBehavior=this.el.getData("offset-behavior")||"top",this.elOffset?(a.one("body").prepend(a.Node.create('\x3cdiv class\x3d"show-on-scroll-wrapper" id\x3d"showOnScrollWrapper"\x3e\x3c/div\x3e')),
this.wrapper=a.one("#showOnScrollWrapper"),this.wrapper.setHTML(this.el._node.outerHTML)):console.warn("No show on scroll offset element found.")):console.warn("No show on scroll element found.")},bindUI:function(){this.scrollEvents();a.one(window).on("resize",function(){this.syncUI()},this)},syncUI:function(){this.getVariables()},getVariables:function(){this.navShowPosition="bottom"==this.offsetBehavior?this.elOffset.getY()+this.elOffset.get("offsetHeight"):this.elOffset.getY()},scrollEvents:function(){this.scrolling=
!1;a.one(window).on("scroll",function(){!1===this.scrolling&&(this.scrolling=!0,this.scrollLogic(),helper.debounce(function(){this.scrolling=!1},300,this))},this)},scrollLogic:function(){window.scrollY>this.navShowPosition?this.wrapper.addClass("show"):this.wrapper.removeClass("show");a.later(100,this,function(){!0===this.scrolling&&window.requestAnimationFrame(a.bind(function(){this.scrollLogic()},this))})}})});